<?php /* Smarty version 2.6.20, created on 2016-07-27 10:30:53
         compiled from ./historyPurchases/index.php */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'default', './historyPurchases/index.php', 13, false),array('modifier', 'date_format', './historyPurchases/index.php', 13, false),array('block', 'historyPurchases', './historyPurchases/index.php', 40, false),array('function', 'url', './historyPurchases/index.php', 62, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "admin/top.php", 'smarty_include_vars' => array('subject' => 'historyPurchases')));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<div id="content">
    <div id="boxquery">
    <form method="get">
    	<input type="hidden" name="m" value="inventory" />
        <input type="hidden" name="s" value="historyPurchases.php" />
        <input type="hidden" name="id" value="<?php echo $_GET['id']; ?>
" />
        <input type="hidden" name="shopid" value="<?php echo $_GET['shopid']; ?>
" />
        <input type="hidden" id="order" name="" value="" />
        <input type="submit" id="search" value="查询" class="fr" />
        <li class="yui-skin-sam">入库时间:&nbsp; 
            <input id="sdate" name="sdate" type="text" size="12" value="<?php echo $_GET['sdate']; ?>
" onfocus="lockinput(this)" />
            <input id="edate" name="edate" type="text" size="12" value="<?php echo ((is_array($_tmp=((is_array($_tmp=@$_GET['edate'])) ? $this->_run_mod_handler('default', true, $_tmp, time()) : smarty_modifier_default($_tmp, time())))) ? $this->_run_mod_handler('date_format', true, $_tmp, '%Y-%m-%d') : smarty_modifier_date_format($_tmp, '%Y-%m-%d')); ?>
" onfocus="lockinput(this)" />
            <div id="calContainer" style="display:none; position:absolute;"></div>
        </li>
        <li>供应商:&nbsp;
        <input name="supplier" type="text" id="supplier" value="<?php echo $_GET['supplier']; ?>
" size="16" onclick="select()" oninput="context_menu_suppliers(this, 'supplierid=[id],supplier=[title]')" onfocus="context_menu_suppliers(this, 'supplierid=[id],supplier=[title]')" />
        <input type="hidden" name="supplierid" id="supplierid" value="<?php echo $_GET['supplierid']; ?>
" />
        </li>
        <li>真实采购单价:&nbsp; 
        	<input id="sprice" name="sprice" type="text" size="10" value="<?php echo $_GET['sprice']; ?>
" />-
            <input id="mprice" name="mprice" type="text" size="10" value="<?php echo $_GET['mprice']; ?>
" />
        </li>
    </form>
    </div>
    
    <table width="100%" border="0" cellspacing="0" cellpadding="0" id="lister">
      <tr id="title">
        <td width="40">SKU_ID</td>
        <td>商品图片</td>
        <td>商品名称</td>
        <td>供应商</td>
        <td>采购单价</td>
        <td>货币单位</td>
        <td>数量</td>
        <td>折扣</td>
        <td><a href="javascript:doorder('priceorder','<?php if ($_GET['priceorder'] == desc): ?>asc<?php else: ?>desc<?php endif; ?>');">真实采购单价</a></td>
        <td><a href="javascript:doorder('timeorder','<?php if ($_GET['timeorder'] == desc): ?>asc<?php else: ?>desc<?php endif; ?>');">入库时间</a></td>
      </tr>
      <?php $this->_tag_stack[] = array('historyPurchases', array('limit' => 20,'pager' => 'pager','page' => $this->_tpl_vars['segment']['page'],'timeorder' => $_GET['timeorder'],'priceorder' => $_GET['priceorder'],'productid' => $_GET['id'],'shopid' => $_GET['shopid'],'sdate' => $_GET['sdate'],'edate' => $_GET['edate'],'supplierid' => $_GET['supplierid'],'sprice' => $_GET['sprice'],'mprice' => $_GET['mprice'],'counter' => 1)); $_block_repeat=true;smarty_block_historyPurchases($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?>
      <tr id="content">
        <td><?php echo $this->_tpl_vars['historyPurchases']['productid']; ?>
</td>
        <td><img src="<?php echo $this->_tpl_vars['historyPurchases']['pic']; ?>
" width="80"></td>
        <td><?php echo $this->_tpl_vars['historyPurchases']['product']; ?>
</td>
        <td><?php echo $this->_tpl_vars['historyPurchases']['supplier']; ?>
</td>
        <td><?php echo $this->_tpl_vars['historyPurchases']['pricebuy']*1; ?>
</td>
        <td><?php echo $this->_tpl_vars['historyPurchases']['currency_unit']; ?>
</td>
        <td><?php echo $this->_tpl_vars['historyPurchases']['number']; ?>
</td>
        <td><?php echo $this->_tpl_vars['historyPurchases']['discount']; ?>
</td>
        <td><?php echo $this->_tpl_vars['historyPurchases']['realpricebuy']; ?>
</td>
        <td><?php echo ((is_array($_tmp=$this->_tpl_vars['historyPurchases']['timestocked'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d %H:%M:%S") : smarty_modifier_date_format($_tmp, "%Y-%m-%d %H:%M:%S")); ?>
</td>
      </tr>
      <?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_historyPurchases($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?>
      <?php if ($this->_tpl_vars['pager']->rows == 0): ?>
      <tr id="content">
        <td colspan="20">&nbsp;</td>
      </tr>
      <?php endif; ?>
    </table>
    <div id="pager" class="mt10">
        <?php if ($this->_tpl_vars['pager']): ?><span class="fr"><strong>合计</strong>: 数量:<?php echo $this->_tpl_vars['counter']['number']+0; ?>
 /&nbsp; 采购均价:<?php echo $this->_tpl_vars['counter']['avgprice']+0; ?>
 /&nbsp; 真实采购均价:<?php echo $this->_tpl_vars['realcounter']['avgprice']+0; ?>
</span>共<?php echo $this->_tpl_vars['pager']->rows; ?>
条记录 第<?php echo $this->_tpl_vars['pager']->pagecurrent; ?>
/<?php echo $this->_tpl_vars['pager']->pages; ?>
页 <?php endif; ?> 		
        <?php if ($this->_tpl_vars['pager']->current > 1): ?><a href="<?php echo smarty_function_url(array('s1' => 1), $this);?>
">首页</a><?php endif; ?>
        <?php if ($this->_tpl_vars['pager']->current > 1): ?><a href="<?php echo smarty_function_url(array('s1' => $this->_tpl_vars['pager']->current-1), $this);?>
">上页</a><?php endif; ?>
        <?php if ($this->_tpl_vars['pager']->current < $this->_tpl_vars['pager']->pages): ?><a href="<?php echo smarty_function_url(array('s1' => $this->_tpl_vars['pager']->current+1), $this);?>
">下页</a><?php endif; ?>
        <?php if ($this->_tpl_vars['pager']->current < $this->_tpl_vars['pager']->pages): ?><a href="<?php echo smarty_function_url(array('s1' => $this->_tpl_vars['pager']->pages), $this);?>
">尾页</a><?php endif; ?>
	</div>
</div>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "admin/bottom.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
</body>
</html>